<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>QRCode</title>
<meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="description" content="">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript" src="../../s/qrcode/qrcode.js"></script>
</head>
<body>
	<div>
		<div>
			<div id="qrcode" style="float: left; width: 300px; height: 300px; border: 1px solid #3333ff;">
				<!-- [qrcode] -->
			</div>
			<textarea id="output" style="float: left; width: 500px; height: 298px;" readonly="readonly"></textarea>
			<div style="clear: both;"></div>
		</div>
		<input id="input" type="text" value="" style="width: 300px;" />
		<button onclick="build()">Confirm</button>
	</div>
	<script>
		var oQRCode = new QRCode('qrcode', {
			//text : '',
			width : 300,
			height : 300,
			colorDark : "#000",
			colorLight : "#fff",
		});

		var build = function() {
			var value = document.querySelector('#input').value;
			oQRCode.clear();
			oQRCode.makeCode(value);
			setTimeout(function() {
				document.querySelector('#output').value = document.querySelector('#qrcode img').src;
			}, 50);
		};
	</script>
</body>
</html>